using System;
using System.Collections;

namespace Evaluant.Uss.Commands
{
	[Serializable]
	public class CompoundCreateCommand : CreateEntityCommand
	{
		public CompoundCreateCommand(string id, string type, ICollection commands) : base(id, type)
		{
			InnerCommands.AddRange(commands);
		}

		public override void Accept(ICommandProcessor processor)
		{
			processor.Process(this);
		}

		private ArrayList _innerCommands = new ArrayList();

		/// <summary>
		/// Gets the inner commands.
		/// </summary>
		/// <value>The inner commands.</value>
		/// <remarks>This can only be made of CreateAttributeCommand items</remarks>
		public ArrayList InnerCommands
		{
			get { return _innerCommands; }
		}

		public override void UpdateIds(Hashtable newIds)
		{
			// Nothing to do as CreateEntity commands are the one which create new Idsbase
		}

	}
}
